package student.aistar.day09;

public class StringBuilderMethod {
    public static void main(String[] args) {
        StringBuilder x = new StringBuilder("abcd");//String -> StringBuilder
        System.out.println(x);

        StringBuilder result = x.delete(1, 3);//[1, 3)
        System.out.println("result: " + result);//ad
        System.out.println("x: " + x);//ad

        System.out.println(x.deleteCharAt(0));
        x.insert(0, "mua");
        System.out.println(x);//muad

        //反转字符串
        System.out.println(x.reverse());//daum


        //StringBuilder -> String
        System.out.println(x.toString());
    }
}
